export function getMonthAndDay() {
	const now = new Date();
	const m = now.getMonth();
	let str = "";
	switch(m) {
		case 0: str = "一月";break;
		case 1: str = "二月";break;
		case 2: str = "三月";break;
		case 3: str = "四月";break;
		case 4: str = "五月";break;
		case 5: str = "六月";break;
		case 6: str = "七月";break;
		case 7: str = "八月";break;
		case 8: str = "九月";break;
		case 9: str = "十月";break;
		case 10: str = "十一月";break;
		case 11: str = "十二月";break;
	}
	
	const d = now.getDay();
	switch(d) {
		case 0: str += " 周日";break;
		case 1: str += " 周一";break;
		case 2: str += " 周二";break;
		case 3: str += " 周三";break;
		case 4: str += " 周四";break;
		case 5: str += " 周五";break;
		case 6: str += " 周六";break;
	}
	
	return str;
}


export function data_string(str, value) {
	if (value == "yyyy-MM-dd hh:mm:ss") {
		var d = new Date(str);
		var ar_date = [d.getFullYear(), d.getMonth() + 1, d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds()];
		for (var i = 0; i < ar_date.length; i++) ar_date[i] = dFormat(ar_date[i]);
		return ar_date.slice(0, 3).join('-') + ' ' + ar_date.slice(3).join(':');
		function dFormat(i) { return i < 10 ? "0" + i.toString() : i; }
	}
	else if (value == "yyyy-MM-dd") {
		var d = new Date(str);
		var ar_date = [d.getFullYear(), d.getMonth() + 1, d.getDate()];
		for (var i = 0; i < ar_date.length; i++) ar_date[i] = dFormat(ar_date[i]);
		return ar_date.join('-');
		function dFormat(i) { return i < 10 ? "0" + i.toString() : i; }
	}
 }